A virtual machine, such as the Java Virtual Machine (JVM) is a virtual computer component that resides in memory on a computer. For an application to be executed on different types of data processing systems, a compiler typically generates an architecture-neutral file format so that the compiled code is executable on any processor, so long as the JVM is accessible by the processor. The architecture-neutral file format consists of bytecode instructions that are generated by a Java compiler and are non-specific to a given computer architecture. A bytecode is a machine independent code generated by the Java compiler and executed by a Java interpreter. A Java interpreter, part of the JVM, alternately decodes and interprets an intermediary code called “bytecode”. These bytecode instructions are designed to be easily interpreted on any platform and easily translated into native machine code.
Programs written in an interpreted programming language may be executed by such a programming virtual machine. Theoretically, any programming language may be interpreted; however the term “interpreted programming language” traditionally designates languages that are implemented through execution by an interpreter. The term “interpreted programming language” also designates languages for which no compilers are written.
In many interpreted languages, a basic interpreter translates basic code into native machine code. In an interpreted language such as Java, rather than generating native machine code, a compiler generates bytecodes to be used by the programming virtual machine The Java virtual machine then translates the bytecodes into native machine code. Java, has an intermediate bytecode stage, because it is faster to translate bytecodes into native machine code than translating Java code, and bytecodes are machine/architecture independent, e.g. you can take bytecodes generated on one type of machine (UNIX) and bring them to totally different hardware, where the virtual machine will interpret them for use. These bytecodes provide the control and data necessary to execute an application. Subsequently, to actually execute an interpreted programming language application, an interpreter interprets the compiled bytecodes generated by the compiler.
Java is a well-known interpreted programming language and it is used herein as a preferred example. However, it should be well understood to those skilled in the art that other interpreted programming languages, such as REXX, BASIC, SmallTalk, Python, Perl and the like are within the scope of this invention.
Java is a software programming language, originally developed by Sun Microsystems, that is designed to generate applications that can run on all hardware platforms without modification. Because of this, Java applications have found extensive use on the World Wide Web (WWW). Java applications can be called from within hypertext markup language (HTML) documents or launched stand alone.
As is known to those skilled in the art, a WWW server may include facilities for storing and transmitting application programs, such as application programs written in Java, for execution on a client computer.
Java Web Start (JWS) provides a mechanism to run Java applications without installing anything on the client computer except a virtual machine and JWS. Generally, JWS simply downloads the Java application jar files from the server whenever the Java application is launched on the client computer. This takes advantage of the Java code's machine-independence to easily update the Java application when it is launched the next time on the client computer.
However, the virtual machine used by a web start application and subsequently by the main application is currently chosen in a manner that does not always optimize memory resources. Again, using the specific example of Java Web Start, JWS uses one JVM to run Java Web Start and the same JVM to run the main Java application, whether or not there are other JVMs available for use. This slows the running of both JWS and the main Java application on the one JVM. This is due to Java Web Start adding between 10-15 MB of memory overhead to every application started through Web Start because many swing classes and GUI classes that are in the jar file are loaded automatically by JWS onto the JVM, whether or not the classes are needed.
Additional overhead is added to the running of the main application because JWS does not guarantee the JVM version that the main application will run under. For example, if there are multiple JVMs installed on the same client computer, JWS can fork off any one of the JVMs depending on how they are registered in the system registry. This causes problems when the main application needs to be run inside a certain JVM—because of JVM version requirements, specific libraries installed to the particular JVM, etc. Moreover, as the various classes in the jar file are downloaded, JWS downloads them into its own web start cache location, obfuscating the filenames in the process so it is difficult to find the files that should be copied to a desired JVM. The term “web start cache” refers to a location on a client computer where the web start application stores copies of particular files in order to more easily access the files rather than having to request the files each time from the server. In some instances this cache may also be located at an intermediary location nearer to the client than to the server.
It would be desirable therefore to provide a mechanism to install and update applications written in interpreted programming languages so that they are installed using a designated virtual machine, particularly a local virtual machine which is not the same machine as that being used by the web start application.
It would be desirable to provide a mechanism to install and update applications written in interpreted programming languages so that only desired classes, of a desired virtual machine version, are loaded on the designated virtual machine.
The present invention provides a method and system for installing and updating applications written in interpreted programming languages from the server in order to overcome the objections described above.